﻿#Region "License & Usage"

'Microsoft Public License (Ms-PL) 

'This license governs use of the accompanying software. If you use the 
'software, you accept this license. If you do not accept the license, do 
'not use the software. 

'1. Definitions 

'The terms "reproduce," "reproduction," "derivative works," and 
'"distribution" have the same meaning here as under U.S. copyright law. 

'A "contribution" is the original software, or any additions or changes 
'to the software. 

'A "contributor" is any person that distributes its contribution under 
'this license. 

'"Licensed patents" are a contributor's patent claims that read directly 
'on its contribution. 

'2. Grant of Rights 

'(A) Copyright Grant- Subject to the terms of this license, including the 
'license conditions and limitations in section 3, each contributor grants 
'you a non-exclusive, worldwide, royalty-free copyright license to 
'reproduce its contribution, prepare derivative works of its 
'contribution, and distribute its contribution or any derivative works 
'that you create. 

'(B) Patent Grant- Subject to the terms of this license, including the 
'license conditions and limitations in section 3, each contributor grants 
'you a non-exclusive, worldwide, royalty-free license under its licensed 
'patents to make, have made, use, sell, offer for sale, import, and/or 
'otherwise dispose of its contribution in the software or derivative 
'works of the contribution in the software. 

'3. Conditions and Limitations 

'(A) No Trademark License- This license does not grant you rights to use 
'any contributors' name, logo, or trademarks. 

'(B) If you bring a patent claim against any contributor over patents 
'that you claim are infringed by the software, your patent license from 
'such contributor to the software ends automatically. 

'(C) If you distribute any portion of the software, you must retain all 
'copyright, patent, trademark, and attribution notices that are present 
'in the software. 

'(D) If you distribute any portion of the software in source code form, 
'you may do so only under this license by including a complete copy of 
'this license with your distribution. If you distribute any portion of 
'the software in compiled or object code form, you may only do so under a 
'license that complies with this license. 

'(E) The software is licensed "as-is." You bear the risk of using it. The 
'contributors give no express warranties, guarantees or conditions. You 
'may have additional consumer rights under your local laws which this 
'license cannot change. To the extent permitted under your local laws, 
'the contributors exclude the implied warranties of merchantability, 
'fitness for a particular purpose and non-infringement.

#End Region

#Region "Options"

Option Strict On
Option Explicit On

#End Region

#Region "Imports"

'From .Net Framework 3.5
Imports Microsoft.Drawing
Imports System.Drawing
Imports System.IO
Imports System.Windows.Forms

'From Custom Classes/Reference
Imports StedySoft.SenseSDK
Imports StedySoft.SenseSDK.DrawingCE
Imports SenseSDKExtended.DrawingCEEx

#End Region

Namespace SensePanelNumericItemEx

    ''' <summary>SensePanelNumericItemEx.HTC2DigitStyle1</summary>
    ''' <author>Greenhacks</author>
    ''' <author-reference>None</author-reference>
    ''' <copyright>None</copyright>
    ''' <version>0.2</version>
    ''' <remarks>None</remarks>
    ''' <reference>None</reference>
    Public Class HTC2DigitStyle1
        Inherits SensePanelBase
        Implements IDisposable

#Region "Fields"

        'General Flags
        Private _disposed As Boolean = False
        Private _clickedUP As Boolean = False
        Private _clickedDW As Boolean = False
        Private _autoShowDialog As Boolean = False

        'General Properties
        Private _name As String = Nothing
        Private _autoShowDialogText As String = "Select a number..."

        'PrimaryText Properties
        Private _primaryText As String = Nothing
        Private _primaryTextRectangle As Rectangle = Nothing
        Private _primaryTextFontName As String = "Tahoma" '"Helvetica Neue OTS"
        Private _primaryTextFontSize As Single = 9.0F
        Private _primaryTextFontStyle As System.Drawing.FontStyle = FontStyle.Regular
        Private _primaryTextForeColor As System.Drawing.Color = Color.Black
        Private _primaryTextBackColor As System.Drawing.Color = Color.Gray
        Private _primaryTextAlignment As System.Drawing.StringAlignment = StringAlignment.Near

        'SecondaryText Properties
        Private _secondaryText As String = Nothing
        Private _secondaryTextRectangle As Rectangle = Nothing
        Private _secondaryTextFontName As String = "Tahoma" '"Helvetica Neue OTS"
        Private _secondaryTextFontSize As Single = 7.0F
        Private _secondaryTextFontStyle As System.Drawing.FontStyle = FontStyle.Regular
        Private _secondaryTextForeColor As System.Drawing.Color = Color.Black
        Private _secondaryTextBackColor As System.Drawing.Color = Color.Gray
        Private _secondaryTextAlignment As System.Drawing.StringAlignment = StringAlignment.Near

        'Value Properties
        '<CLSCompliant(False)> _
        Private _valueText As Integer = Nothing
        Private _valueTextRectangle As Rectangle = Nothing
        Private _valueTextFontName As String = "Tahoma" '"Helvetica Neue OTS"
        Private _valueTextFontSize As Single = 11.0F
        Private _valueTextFontStyle As System.Drawing.FontStyle = FontStyle.Bold
        Private _valueTextForeColor As System.Drawing.Color = Color.Black
        Private _valueTextAlignment As System.Drawing.StringAlignment = StringAlignment.Near
        Private _valueTextEx As Integer = Nothing

        '<CLSCompliant(False)> _
        Private _valueMinimum As Integer = Nothing
        '<CLSCompliant(False)> _
        Private _valueMaximum As Integer = Nothing

        'Private path_resources_root As String = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase.Substring(0, System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase.LastIndexOf("\")) & "\Resources\"
        Private path_2digit_background As IImage = _getIImageFromResource("numericbox.2.digit.back") 'DrawingCE.SenseAPIs.SenseImage.LoadIImageFromFile(path_resources_root & If(DrawingCE.Resolution.ScreenIsVGA, "SensePanelNumericItemEx.HTC2DigitStyle1.Back.VGA", "SensePanelNumericItemEx.HTC2DigitStyle1.Back.QVGA") & ".png")
        Private path_2digit_pressedup As IImage = _getIImageFromResource("numericbox.up.pressed") 'DrawingCE.SenseAPIs.SenseImage.LoadIImageFromFile(path_resources_root & If(DrawingCE.Resolution.ScreenIsVGA, "SensePanelNumericItemEx.HTCStyle1.PressedUp.VGA", "SensePanelNumericItemEx.HTCStyle1.PressedUp.QVGA") & ".png")
        Private path_2digit_presseddown As IImage = _getIImageFromResource("numericbox.down.pressed") 'DrawingCE.SenseAPIs.SenseImage.LoadIImageFromFile(path_resources_root & If(DrawingCE.Resolution.ScreenIsVGA, "SensePanelNumericItemEx.HTCStyle1.PressedDown.VGA", "SensePanelNumericItemEx.HTCStyle1.PressedDown.QVGA") & ".png")

        'Hold Images
        Private _iThumbnailLeft As Microsoft.Drawing.IImage = Nothing
        Private _iThumbnailRight As Microsoft.Drawing.IImage = path_2digit_background

        'Hold Cordinates
        Private _iThumbnailLeftRectangle As Rectangle = Nothing
        Private _iThumbnailRightRectangle As Rectangle = Nothing

        'Hold Margins
        Private _iThumbnailLeftMarginLR As Double = 0
        Private _iThumbnailLeftMarginTB As Double = 0
        Private _iThumbnailRightMarginLR As Double = 0
        Private _iThumbnailRightMarginTB As Double = 0

        Private _myCurrentPosition As Integer = 0

#End Region

#Region "Events"

        ''' <summary>
        ''' OnValueChanged Event
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="value"></param>
        ''' <remarks></remarks>
        Public Event OnValueChanged As ValueChangedEventHandler '(ByVal sender As Object, ByVal value As Integer)

        ''' <summary>
        ''' ValueChangedEventHandler
        ''' </summary>
        ''' <param name="Sender"></param>
        ''' <param name="Value"></param>
        ''' <remarks></remarks>
        Public Delegate Sub ValueChangedEventHandler(ByVal Sender As Object, ByVal Value As Integer)

#End Region

#Region "Methods"

        ''' <summary>
        ''' Constructor
        ''' </summary>
        ''' <remarks>None</remarks>
        Public Sub New()

            Try

                'Do Nothing

            Catch ex As Exception

                'Throw exception if any other error caught
                Throw New Exception(ex.Message)

            End Try

        End Sub

        ''' <summary>
        ''' Constructor
        ''' </summary>
        ''' <remarks>None</remarks>
        Public Sub New(ByVal Name As String)

            Try

                'Save name property
                _name = Name

            Catch ex As Exception

                'Throw exception if any other error caught
                Throw New Exception(ex.Message)

            End Try

        End Sub

        ''' <summary>
        ''' _getIImageFromResource
        ''' </summary>
        ''' <param name="resource"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function _getIImageFromResource(ByVal resource As String) As IImage
            Dim iimg As IImage = Nothing
            Using strm As MemoryStream = If(_isVGA, SenseSDKExtended.Resources.VGA.Images.GetIImageFromResource(resource), SenseSDKExtended.Resources.QVGA.Images.GetIImageFromResource(resource))
                ImagingFactory.GetImaging.CreateImageFromBuffer(strm.GetBuffer, Convert.ToUInt32(strm.Length), BufferDisposalFlag.BufferDisposalFlagNone, iimg)
            End Using
            Return iimg
        End Function

        ''' <summary>
        ''' Dispose
        ''' </summary>
        ''' <remarks>None</remarks>
        Public Overrides Sub Dispose()

            Try

                Me._dispose(True)
                GC.SuppressFinalize(Me)
                MyBase.Dispose()

            Catch ex As Exception

                'Throw exception if any other error caught
                Throw New Exception(ex.Message)

            End Try

        End Sub

        ''' <summary>
        ''' _Dispose
        ''' </summary>
        ''' <param name="disposing"></param>
        ''' <remarks>None</remarks>
        Private Sub _dispose(ByVal disposing As Boolean)

            Try

                Me._disposed = True

            Catch ex As Exception

                'Throw exception if any other error caught
                Throw New Exception(ex.Message)

            End Try
        End Sub

        ''' <summary>
        ''' Check if it is VGA or QVGA
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function _isVGA() As Boolean

            Try

                'Return the output
                Return StedySoft.SenseSDK.DrawingCE.Resolution.ScreenIsVGA

            Catch ex As Exception

                'Throw exception if any other error caught
                Throw New Exception(ex.Message)

            End Try

        End Function

        Public Overrides Sub OnMouseDown(ByVal x As Integer, ByVal y As Integer, ByRef cancelScroll As Boolean)
            MyBase.OnMouseDown(x, y, cancelScroll)

            _clickedDW = True

            _myCurrentPosition = y

        End Sub

        Public Overrides Sub OnMouseMove(ByVal x As Integer, ByVal y As Integer)
            MyBase.OnMouseMove(x, y)

            _clickedDW = False

        End Sub

        ''' <summary>
        ''' OnMouseUp
        ''' </summary>
        ''' <param name="x"></param>
        ''' <param name="y"></param>
        ''' <remarks></remarks>
        Public Overrides Sub OnMouseUp(ByVal x As Integer, ByVal y As Integer)
            MyBase.OnMouseUp(x, y)

            _clickedDW = False

            'Check controls current position
            If Not y = _myCurrentPosition Then

                'Then exit sub to avoid raising other events
                Exit Sub

            End If

            'Hold Mouse click cordinates
            Dim mousePoint As System.Drawing.Point = System.Windows.Forms.Control.MousePosition()
            Dim pointX As Integer = mousePoint.X - MyBase.ClientRectangle.X
            Dim pointY As Integer = y - MyBase.ClientRectangle.Y

            Select Case pointX

                Case _iThumbnailRightRectangle.Left To _iThumbnailRightRectangle.Left + _iThumbnailRightRectangle.Width

                    Select Case pointY

                        Case Is < CInt(ClientRectangle.Height / 2) - 4

                            If _valueText = _valueMaximum Then
                                _valueText = _valueMinimum
                            Else
                                _valueText += 1
                            End If

                            _clickedUP = False

                            Exit Sub

                        Case Is > CInt(ClientRectangle.Height / 2) - 4

                            If _valueText = _valueMinimum Then
                                _valueText = _valueMaximum
                            Else
                                _valueText -= 1
                            End If

                            _clickedUP = False

                            Exit Sub

                    End Select

                Case _iThumbnailLeftRectangle.Left To _iThumbnailLeftRectangle.Left + _iThumbnailLeftRectangle.Width

                    Dim a As String = Nothing

                Case Else

                    If _autoShowDialog Then

                        _valueText = SenseAPIsEx.SenseNumericBox.HTCStyle1.NumericBox(_autoShowDialogText, _valueText, _valueMinimum, _valueMaximum)

                    End If

            End Select

        End Sub

        ''' <summary>
        ''' Draw_HTC2DigitStyle1
        ''' </summary>
        ''' <param name="g"></param>
        ''' <remarks></remarks>
        Public Sub Draw_HTC2DigitStyle1(ByVal g As System.Drawing.Graphics)

            Dim _iThumbnailLeftMarginLR As Integer = If(_isVGA, 20, 10)
            Dim _iThumbnailLeftMarginTB As Integer = If(_isVGA, 20, 10)
            Dim _iThumbnailLeftX As Integer = If(_isVGA, 10, 5)
            Dim _iThumbnailLeftY As Integer = If(_isVGA, 10, 5)
            Dim _iThumbnailLeftW As Integer = If(Not _iThumbnailLeft Is Nothing, SenseAPIs.SenseImage.GetIImageSize(_iThumbnailLeft).Width + _iThumbnailLeftMarginLR, If(_isVGA, 10, 5))
            Dim _iThumbnailLeftH As Integer = If(Not _iThumbnailLeft Is Nothing, SenseAPIs.SenseImage.GetIImageSize(_iThumbnailLeft).Height, 0)

            Dim _iThumbnailRightMarginLR As Integer = If(_isVGA, 20, 10)
            Dim _iThumbnailRightMarginTB As Integer = If(_isVGA, 20, 10)
            Dim _iThumbnailRightX As Integer = If(_isVGA, 10, 5)
            Dim _iThumbnailRightY As Integer = If(_isVGA, 10, 5)
            Dim _iThumbnailRightW As Integer = If(Not _iThumbnailRight Is Nothing, SenseAPIs.SenseImage.GetIImageSize(_iThumbnailRight).Width + _iThumbnailRightMarginLR, If(_isVGA, 10, 5))
            Dim _iThumbnailRightH As Integer = If(Not _iThumbnailRight Is Nothing, SenseAPIs.SenseImage.GetIImageSize(_iThumbnailRight).Height, 0)

            Dim _primaryTextMarginTB As Integer = If(_isVGA, 20, 10)
            Dim _primaryTextX As Integer = _iThumbnailLeftW
            Dim _primaryTextY As Integer = If(_isVGA, 10, 5)
            Dim _primaryTextW As Integer = Screen.PrimaryScreen.Bounds.Width - (_iThumbnailLeftW + _iThumbnailRightW)
            Dim _primaryTextH As Integer = SenseAPIsEx.SenseStrings.CalculateStringHeight(SenseAPIsEx.SenseStrings.GetTrimmedDottedText(_primaryText, _primaryTextFontName, CInt(_primaryTextFontSize), _primaryTextFontStyle, New Size(_primaryTextW, _primaryTextH), g), _primaryTextFontName, CInt(_primaryTextFontSize), _primaryTextFontStyle, New Size(_primaryTextW, Nothing))

            Dim _secondaryTextMarginTB As Integer = If(_isVGA, 20, 10)
            Dim _secondaryTextX As Integer = _iThumbnailLeftW
            Dim _secondaryTextY As Integer = _primaryTextH + If(_isVGA, 10, 5)
            Dim _secondaryTextW As Integer = Screen.PrimaryScreen.Bounds.Width - (_iThumbnailLeftW + _iThumbnailRightW)
            Dim _secondaryTextH As Integer = SenseAPIsEx.SenseStrings.CalculateStringHeight(SenseAPIsEx.SenseStrings.GetTrimmedDottedText(_secondaryText, _secondaryTextFontName, CInt(_secondaryTextFontSize), _secondaryTextFontStyle, New Size(_secondaryTextW, _secondaryTextH), g), _secondaryTextFontName, CInt(_secondaryTextFontSize), _secondaryTextFontStyle, New Size(_secondaryTextW, Nothing))

            Dim _valueTextMarginTB As Integer = If(_isVGA, 20, 10)
            Dim _valueTextX As Integer = _iThumbnailLeftW + _primaryTextW + If(_isVGA, 20, 10)
            Dim _valueTextY As Integer = If(_isVGA, 10, 5)
            Dim _valueTextW As Integer = If(_isVGA, 52, 26)
            Dim _valueTextH As Integer = ClientRectangle.Height - If(_isVGA, 20, 10)

            _primaryTextRectangle = New Rectangle(_primaryTextX, _primaryTextY, _primaryTextW, _primaryTextH)
            _secondaryTextRectangle = New Rectangle(_secondaryTextX, _secondaryTextY, _secondaryTextW, _secondaryTextH)
            _valueTextRectangle = New Rectangle(_valueTextX, _valueTextY, _valueTextW, _valueTextH)

            If _clickedDW Then

                'g.DrawImageAlphaChannel(path_2digit_presseddown,New Rectangle(,,,)

            End If

            If Not _iThumbnailLeft Is Nothing Then

                _iThumbnailLeftRectangle = New Rectangle(ClientRectangle.Left + If(_isVGA, 10, 5), ClientRectangle.Top + CInt((ClientRectangle.Height - SenseAPIs.SenseImage.GetIImageSize(_iThumbnailLeft).Height) / 2), SenseAPIs.SenseImage.GetIImageSize(_iThumbnailLeft).Width, SenseAPIs.SenseImage.GetIImageSize(_iThumbnailLeft).Height)
                _iThumbnailLeftMarginTB = If(_isVGA, 10, 5)
                _iThumbnailLeftMarginLR = If(_isVGA, 10, 5)

                Dim ___iThumbnailLeft As IImage = _iThumbnailLeft
                g.DrawImageAlphaChannel(___iThumbnailLeft, New Rectangle(CInt(_iThumbnailLeftRectangle.Left), CInt(_iThumbnailLeftRectangle.Top), _iThumbnailLeftRectangle.Width, _iThumbnailLeftRectangle.Height))

            End If

            If Not _iThumbnailRight Is Nothing Then

                _iThumbnailRightRectangle = New Rectangle(Screen.PrimaryScreen.Bounds.Width - (SenseAPIs.SenseImage.GetIImageSize(_iThumbnailRight).Width + If(_isVGA, 10, 5)), ClientRectangle.Top + CInt((ClientRectangle.Height - SenseAPIs.SenseImage.GetIImageSize(_iThumbnailRight).Height) / 2), SenseAPIs.SenseImage.GetIImageSize(_iThumbnailRight).Width, SenseAPIs.SenseImage.GetIImageSize(_iThumbnailRight).Height)
                _iThumbnailRightMarginTB = If(_isVGA, 10, 5)
                _iThumbnailRightMarginLR = If(_isVGA, 10, 5)

                Dim ___iThumbnailRight As IImage = _iThumbnailRight
                g.DrawImageAlphaChannel(___iThumbnailRight, New Rectangle(CInt(_iThumbnailRightRectangle.Left), CInt(_iThumbnailRightRectangle.Top), _iThumbnailRightRectangle.Width, _iThumbnailRightRectangle.Height))

            End If

            If Not _primaryText = String.Empty Then
                'Draw the Primary text with other properties like height,color,style,alignment,etc
                Using f As Font = New Font(_primaryTextFontName, _primaryTextFontSize, _primaryTextFontStyle)
                    Dim s As String = SenseAPIsEx.SenseStrings.GetTrimmedDottedText(_primaryText, _primaryTextFontName, CInt(_primaryTextFontSize), _primaryTextFontStyle, New Size(_primaryTextRectangle.Width, _primaryTextRectangle.Height), g)
                    Dim r As Rectangle = New Rectangle(_primaryTextRectangle.Left, ClientRectangle.Top + _primaryTextRectangle.Top, _primaryTextRectangle.Width, _primaryTextRectangle.Height) '(Left,Top,Width,Height)
                    Using b As Brush = New SolidBrush(If(_clickedDW, Color.White, _primaryTextForeColor))
                        Using sf As StringFormat = New StringFormat()
                            sf.Alignment = _primaryTextAlignment
                            sf.FormatFlags = StringFormatFlags.NoWrap
                            g.DrawString(s, f, b, r, sf)
                        End Using
                    End Using
                End Using
            End If

            If Not _secondaryText = String.Empty Then
                'Draw the Secondary text with other properties like height,color,style,alignment,etc
                Using f As Font = New Font(_secondaryTextFontName, _secondaryTextFontSize, _secondaryTextFontStyle)
                    Dim s As String = SenseAPIsEx.SenseStrings.GetTrimmedDottedText(_secondaryText, _secondaryTextFontName, CInt(_secondaryTextFontSize), _secondaryTextFontStyle, New Size(_secondaryTextRectangle.Width, _secondaryTextRectangle.Height), g)
                    Dim r As Rectangle = New Rectangle(_secondaryTextRectangle.Left, ClientRectangle.Top + _secondaryTextRectangle.Top, _secondaryTextRectangle.Width, _secondaryTextRectangle.Height) '(Left,Top,Width,Height)
                    Using b As Brush = New SolidBrush(If(_clickedDW, Color.White, _secondaryTextForeColor))
                        Using sf As StringFormat = New StringFormat()
                            sf.Alignment = _secondaryTextAlignment
                            sf.FormatFlags = StringFormatFlags.NoWrap
                            g.DrawString(s, f, b, r, sf)
                        End Using
                    End Using
                End Using
            End If

            If Not _valueText = _valueTextEx Then

                RaiseEvent OnValueChanged(Me, _valueText)

            End If

            'Draw the Value text with other properties like height,color,style,alignment,etc
            Using f As Font = New Font(_valueTextFontName, _valueTextFontSize, _valueTextFontStyle)
                Dim s As String = _valueText.ToString.PadLeft(2, CChar("0"))
                Dim r As Rectangle = New Rectangle(_valueTextRectangle.Left, ClientRectangle.Top + _valueTextRectangle.Top, _valueTextRectangle.Width, _valueTextRectangle.Height) '(Left,Top,Width,Height)
                Using b As Brush = New SolidBrush(_valueTextForeColor)
                    Using sf As StringFormat = New StringFormat()
                        sf.Alignment = _valueTextAlignment
                        sf.LineAlignment = StringAlignment.Center
                        g.DrawString(s, f, b, r, sf)
                        _valueTextEx = _valueText
                    End Using
                End Using
            End Using

        End Sub

        ''' <summary>
        ''' OnRender
        ''' </summary>
        ''' <param name="g"></param>
        ''' <remarks></remarks>
        Public Overrides Sub OnRender(ByVal g As System.Drawing.Graphics)
            MyBase.OnRender(g)

            Draw_HTC2DigitStyle1(g)

        End Sub

#End Region

#Region "Properties"

        ''' <summary>
        ''' AutoShowDialog
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property AutoShowDialog() As Boolean
            Get
                Return _autoShowDialog
            End Get
            Set(ByVal value As Boolean)
                _autoShowDialog = value
            End Set
        End Property

        ''' <summary>
        ''' AutoShowDialogText
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property AutoShowDialogText() As String
            Get
                Return _autoShowDialogText
            End Get
            Set(ByVal value As String)
                _autoShowDialogText = value
            End Set
        End Property

        ''' <summary>
        ''' Primary Text
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property PrimaryText() As String
            Get
                Return _primaryText
            End Get
            Set(ByVal value As String)
                _primaryText = value
            End Set
        End Property

        ''' <summary>
        ''' PrimaryTextFontName
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property PrimaryTextFontName() As String
            Get
                Return _primaryTextFontName
            End Get
            Set(ByVal value As String)
                _primaryTextFontName = value
            End Set
        End Property

        ''' <summary>
        ''' PrimaryTextFontSize
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property PrimaryTextFontSize() As Single
            Get
                Return _primaryTextFontSize
            End Get
            Set(ByVal value As Single)
                _primaryTextFontSize = value
            End Set
        End Property

        ''' <summary>
        ''' PrimaryTextFontStyle
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property PrimaryTextFontStyle() As System.Drawing.FontStyle
            Get
                Return _primaryTextFontStyle
            End Get
            Set(ByVal value As System.Drawing.FontStyle)
                _primaryTextFontStyle = value
            End Set
        End Property

        ''' <summary>
        ''' PrimaryTextForeColor
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property PrimaryTextForeColor() As System.Drawing.Color
            Get
                Return _primaryTextForeColor
            End Get
            Set(ByVal value As System.Drawing.Color)
                _primaryTextForeColor = value
            End Set
        End Property

        ''' <summary>
        ''' PrimaryTextBackColor
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property PrimaryTextBackColor() As System.Drawing.Color
            Get
                Return _primaryTextBackColor
            End Get
            Set(ByVal value As System.Drawing.Color)
                _primaryTextBackColor = value
            End Set
        End Property

        ''' <summary>
        ''' PrimaryTextAlignment
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property PrimaryTextAlignment() As System.Drawing.StringAlignment
            Get
                Return _primaryTextAlignment
            End Get
            Set(ByVal value As System.Drawing.StringAlignment)
                _primaryTextAlignment = value
            End Set
        End Property

        ''' <summary>
        ''' Secondary Text
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property SecondaryText() As String
            Get
                Return _secondaryText
            End Get
            Set(ByVal value As String)
                _secondaryText = value
            End Set
        End Property

        ''' <summary>
        ''' SecondaryTextFontName
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property SecondaryTextFontName() As String
            Get
                Return _secondaryTextFontName
            End Get
            Set(ByVal value As String)
                _secondaryTextFontName = value
            End Set
        End Property

        ''' <summary>
        ''' SecondaryTextFontSize
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property SecondaryTextFontSize() As Single
            Get
                Return _secondaryTextFontSize
            End Get
            Set(ByVal value As Single)
                _secondaryTextFontSize = value
            End Set
        End Property

        ''' <summary>
        ''' SecondaryTextFontStyle
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property SecondaryTextFontStyle() As System.Drawing.FontStyle
            Get
                Return _secondaryTextFontStyle
            End Get
            Set(ByVal value As System.Drawing.FontStyle)
                _secondaryTextFontStyle = value
            End Set
        End Property

        ''' <summary>
        ''' SecondaryTextForeColor
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property SecondaryTextForeColor() As System.Drawing.Color
            Get
                Return _secondaryTextForeColor
            End Get
            Set(ByVal value As System.Drawing.Color)
                _secondaryTextForeColor = value
            End Set
        End Property

        ''' <summary>
        ''' SecondaryTextBackColor
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property SecondaryTextBackColor() As System.Drawing.Color
            Get
                Return _secondaryTextBackColor
            End Get
            Set(ByVal value As System.Drawing.Color)
                _secondaryTextBackColor = value
            End Set
        End Property

        ''' <summary>
        ''' SecondaryTextAlignment
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property SecondaryTextAlignment() As System.Drawing.StringAlignment
            Get
                Return _secondaryTextAlignment
            End Get
            Set(ByVal value As System.Drawing.StringAlignment)
                _secondaryTextAlignment = value
            End Set
        End Property

        ''' <summary>
        ''' Value
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Value() As Integer
            Get
                Return _valueText
            End Get
            Set(ByVal value As Integer)
                _valueText = value
            End Set
        End Property

        ''' <summary>
        ''' Minimum
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Minimum() As Integer
            Get
                Return _valueMinimum
            End Get
            Set(ByVal value As Integer)
                _valueMinimum = value
            End Set
        End Property

        ''' <summary>
        ''' Maximum
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Maximum() As Integer
            Get
                Return _valueMaximum
            End Get
            Set(ByVal value As Integer)
                _valueMaximum = value
            End Set
        End Property

        ''' <summary>
        ''' iThumbnailLeft
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <CLSCompliant(False)> _
        Public Property iThumbnailLeft() As Microsoft.Drawing.IImage
            Get
                Return _iThumbnailLeft
            End Get
            Set(ByVal value As Microsoft.Drawing.IImage)
                _iThumbnailLeft = value
            End Set
        End Property

#End Region

    End Class

End Namespace